package com.briup.jz.web.controller;

import com.briup.jz.bean.OrderComment;
import com.briup.jz.service.IOrderCommentService;
import com.briup.jz.utils.Message;
import com.briup.jz.utils.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ordercomment")
public class OrderCommentController {
   @Autowired
    private IOrderCommentService iOrderCommentService;
    @PostMapping("/saveorupdate")
    public Message saveorupdate(OrderComment orderComment){
        iOrderCommentService.saveOrUpdate(orderComment);
        return MessageUtil.success("操作成功");
    }
    @GetMapping("/query")
    public  Message query(Long id){
        List<OrderComment> orderComments =iOrderCommentService.query(id);
        return MessageUtil.success(orderComments);
    }
    @GetMapping("/delete")
    public Message delete(Long id){
        iOrderCommentService.deleteByid(id);
        return MessageUtil.success("操作成功");
    }

}
